package me.zhengjie.modules.fund.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import me.zhengjie.base.BaseEntity;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 基金
 */
@Entity
@Getter
@Setter
@Table(name = "fund")
@ToString
public class Fund extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -6569224693810130591L;

    @Id
    @Column(name = "id")
    @NotNull(groups = Update.class)
    @ApiModelProperty(value = "ID", hidden = true)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotBlank
    @Column(unique = true)
    @ApiModelProperty(value = "基金代码")
    private String code;

    @NotBlank
    @ApiModelProperty(value = "拼音缩写")
    private String abbr;

    @NotBlank
    @ApiModelProperty(value = "基金名称")
    private String name;

    @ApiModelProperty(value = "基金分类")
    private String category;

    @ApiModelProperty(value = "拼音")
    private String pinyin;
}
